package com.example.registration.controller;

import com.example.registration.service.LoginService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import java.util.Map;

/**
 * @program: registration
 * @Description: $
 * @Param: $
 * @return: $
 * @Author: xieyongde
 * @Date: 2019-08-20
 */
@Controller
@RequestMapping("/newpassword")
public class NewpasswordController {
    @Resource
    private LoginService loginService;

    public LoginService getLoginService() {
        return loginService;
    }

    public void setLoginService(LoginService loginService) {
        this.loginService = loginService;
    }

    @RequestMapping("/showAdmin.htm")
    @ResponseBody
    public Map showAdmin(Integer id) throws Exception {
        return loginService.showAdmin(id);
    }

    @RequestMapping("/updatepPassword.htm")
    @ResponseBody
    public Map updatepPassword(String newpassword, String oldpassword, String confirmpasswordint, Integer id) throws Exception {
        return loginService.updatepPassword(newpassword, oldpassword, confirmpasswordint, id);
        //http://localhost:8080/sa/user/paging?PageIndex=1&pageSize=20&userName=s
    }
}
